Imports System
Imports System.Data
Imports System.Data.Common
Imports System.Collections.Generic
Imports Microsoft.Practices.EnterpriseLibrary.Data

Namespace DAL.Externo
    Public Class Ambiente
        Public Function Listar() As DataTable
            Dim ds As New DataSet()
            Dim db As Database = DatabaseFactory.CreateDatabase()
            Dim cm As System.Data.Common.DbCommand = db.GetStoredProcCommand("[INF_S_AMBIENTE]")

            Try
                ds = db.ExecuteDataSet(cm)
                ds.Tables(0).TableName = "AMBIENTES"
                Return ds.Tables(0)
            Catch ex As System.Data.SqlClient.SqlException
                Throw New Exception(ex.Message, ex.InnerException)
            End Try
        End Function
    End Class
End Namespace